﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PT.Common;

namespace PT.Patterns {
    public class Note {

        public string Name { get; set; }

        public Rational Duration { get; set; }
        public float Velocity { get; set; }

        public override bool Equals(object other) {
            var note = other as Note;
            if (note == null) {
                return false;
            }

            return Duration.Equals(note.Duration) && Velocity.Equals(note.Velocity) && Name.Equals(note.Name);
        }

        public override int GetHashCode() {
            return Duration.GetHashCode() + Velocity.GetHashCode() + Name.GetHashCode();
        }

        public override string ToString() {
            return string.Format("{0} @ {1}: {2}", Duration.ToString(), Velocity, Name);
        }

    }
}
